﻿using DG.Tweening;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class RoomBegin : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler
{
    public GameObject cg;

    public void OnPointerEnter(PointerEventData eventData)
    {
        this.transform.DOScale(Vector3.one * 2.6f, .2f);
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        this.transform.DOScale(Vector3.one * 2f, .2f);
    }

    public void OnPointerClick(PointerEventData eventData)
    {
        cg.SetActive(true);
        StartCoroutine("WaitStart");
    }

    IEnumerator WaitStart()
    {
        yield return new WaitForSeconds(2f);
        ScenesManager.Instance.JumpToScene(ScenesManager.Scene.GameApp);
        yield break;
    }

    void Start()
    {
        
    }
}
